feat: migrate web search to support Tavily alongside SearXNG#1086
Open
tavily-integrations wants to merge 1 commit intoItzCrazyKns:masterfrom
Open
feat: migrate web search to support Tavily alongside SearXNG#1086tavily-integrations wants to merge 1 commit intoItzCrazyKns:masterfrom
tavily-integrations wants to merge 1 commit intoItzCrazyKns:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
1 issue found across 8 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/lib/config/index.ts">
<violation number="1" location="src/lib/config/index.ts:22">
P1: `SEARCH_PROVIDER` is effectively ignored because `searchProvider` is initialized with a truthy default, preventing env-based initialization.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| search: { | ||
| searxngURL: '', | ||
| tavilyAPIKey: '', | ||
| searchProvider: 'searxng', |
Contributor
There was a problem hiding this comment.
P1: SEARCH_PROVIDER is effectively ignored because searchProvider is initialized with a truthy default, preventing env-based initialization.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/lib/config/index.ts, line 22:
<comment>`SEARCH_PROVIDER` is effectively ignored because `searchProvider` is initialized with a truthy default, preventing env-based initialization.</comment>
<file context>
@@ -18,6 +18,8 @@ class ConfigManager {
search: {
searxngURL: '',
+ tavilyAPIKey: '',
+ searchProvider: 'searxng',
},
};
</file context>
Suggested change
| searchProvider: 'searxng', | |
| searchProvider: '', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
searchProviderfield) orSEARCH_PROVIDERenv varwebSearchaction is affected; academic, social, image, and discover searches remain on SearXNGFiles changed
package.json— Added@tavily/coredependencysrc/lib/config/index.ts— AddedsearchProvider(select),tavilyAPIKey(password) config fields with env var bindingssrc/lib/config/serverRegistry.ts— ExportedgetTavilyAPIKey()andgetSearchProvider()helperssrc/lib/tavily.ts— New Tavily client wrapper that normalizes results to the same shape as SearXNGsrc/lib/agents/search/researcher/actions/webSearch.ts— Dispatches to Tavily or SearXNG based on configured providerDependency changes
@tavily/core(^0.6.4) topackage.jsonEnvironment variable changes
TAVILY_API_KEY— Tavily API key (required only when search provider is set totavily)SEARCH_PROVIDER— Set tosearxng(default) ortavilyto select the web search backendNotes for reviewers
searchDepth: "basic"andmaxResults: 10to match SearXNG's default behavior🤖 Generated with Claude Code
Automated Review
@tavily/coreAPI (import { tavily } from '@tavily/core',client.search()). The return shape fromsearchTavily({ results: [{title, url, content}], suggestions: [] }) is structurally compatible with whatwebSearch.tsconsumes. Config integration follows existing patterns exactly (select/password field types, env variable mapping,[key: string]: anytypedsearchobject requires no type changes). SearXNG remains the default provider so existing functionality is fully preserved. Only two minor issues noted, neither blocks approval.Summary by cubic
Adds Tavily as a configurable web search backend alongside SearXNG. SearXNG stays the default and only the
webSearchaction is updated.New Features
searchProviderin settings orSEARCH_PROVIDER.tavilyAPIKeyand helpers (getTavilyAPIKey,getSearchProvider); newtavily.tsnormalizes results.webSearchdispatches by provider; added@tavily/core.Migration
SEARCH_PROVIDER=tavilyand provideTAVILY_API_KEY.Written for commit e71962e. Summary will update on new commits.